//
//  BYBaseModule.m
//  BYBase
//
//  Created by bai byte on 2025/8/31.
//

#import "BYBaseModule.h"
#import <UIKit/UIKit.h>
#import <BYCore/BYModuleManager.h>
#import <BYCore/BYModuleProtocol.h>
#import "BYBaseProtocol.h"
#import "BYBase.h"

@interface BYBaseModule ()<BYModuleProtocol>

@end

@implementation BYBaseModule

+ (void)load
{
    [BYCore registerDynamicModule:[self class]];
}

- (void)modInit:(BYContext *)context{
    [[BYCore shareInstance] registerService:@protocol(BYBaseProtocol) service:[BYBase class]];
}

- (void)modSplash:(BYContext *)context{
    BYAppDelegate *delegate = (BYAppDelegate *)context.application;
    
    UIViewController *homeVC = [[UIViewController alloc] init];
    homeVC.view.backgroundColor = [UIColor redColor];
    
    UIViewController *mineVC = [[UIViewController alloc] init];
    mineVC.view.backgroundColor = [UIColor yellowColor];

    // 每个tab都加导航栏
    UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:homeVC];
    UINavigationController *mineNav = [[UINavigationController alloc] initWithRootViewController:mineVC];
    // tabbar
    UITabBarController *tabBarController = [[UITabBarController alloc] init];
    tabBarController.viewControllers = @[homeNav, mineNav];
    delegate.window.rootViewController = tabBarController;
}

@end
